/**
 * title: 修改密码
 */
import React, { Component } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import EditPassword from './components/EditPassword';
import EditBox from '../components/EditBox';
import Result from './components/Result';

class BindEmailWrapper extends Component {
  state = {
    success: false,
  };
  changeStatus = b => {
    this.setState({ success: b });
  };
  render() {
    const { success } = this.state;
    return (
      <PageHeaderWrapper
        title="修改密码"
      >
        <EditBox
          title={success ? ' ' : '修改密码'}
          description={success ? ' ' : '您正在尝试修改密码，请分别输入旧密码以及要设置的新密码'}
        >
          {success ? <Result /> : <EditPassword changeStatus={this.changeStatus} />}
        </EditBox>
      </PageHeaderWrapper>
    );
  }
}
export default BindEmailWrapper;
